package com.servlet;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.io.PrintWriter;

public class FirstServlet extends HttpServlet {


    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("************doGet方法执行");

        //在此完成业务请求：跳转到Second.jsp
//        resp.sendRedirect("Second.jsp");

        PrintWriter out = resp.getWriter();
        out.println("202300009 小菊");


    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("***********doPost方法执行");
        doGet(req,resp);
    }
}
